<template>
	<view :style="themeColor">
		<view class="page">
			<view class="flex benben-position-layout flex flex-wrap align-center pointsMall_flex_0"
				:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
				<view class='flex flex-wrap align-center justify-between flex-sub pointsMall_fd0_0'>
					<view class='flex flex-wrap align-center pointsMall_fd0_0_c0' @tap.stop="handleJumpDiy"
						data-type="back" data-url="1">
						<text class='fu-iconfont2  pointsMall_fd0_0_c0_c0'>&#xe794;</text>
					</view>
					<text class='pointsMall_fd0_0_c1'>积分商城</text>
					<view class='flex flex-wrap align-center justify-end pointsMall_fd0_0_c0'>
					</view>
				</view>

			</view>
			<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
			<!---flex布局flex布局开始-->
			<view class="flex flex-direction flex-wrap align-center benben-flex-layout pointsMall_flex_1">
				<text class='pointsMall_fd1_0'>{{userData.jifen}}</text>
				<text class='pointsMall_fd1_1'>账户积分</text>
				<button class='pointsMall_fd1_2' @tap.stop="popupShow1679739249303=true">积分规则</button>
			</view>

			<!---flex布局flex布局结束-->
			<!---flex布局flex布局开始-->
			<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout pointsMall_flex_2">
				<view class='flex flex-wrap align-center justify-between pointsMall_fd2_0'>
					<view class='flex flex-direction flex-wrap align-center' @tap.stop="handleJumpDiy"
						data-type="navigateTo" :data-url="`/pages/integral/exchangeRecords/exchangeRecords`">
						<image class='pointsMall_fd2_0_c0_c0' mode="aspectFit" :src='STATIC_URL+"241.png"'></image>
						<text class='pointsMall_fd2_0_c0_c1'>兑换记录</text>
					</view>
					<view class='flex flex-direction flex-wrap align-center' @tap.stop="handleJumpDiy"
						data-type="navigateTo" :data-url="`/pages/integral/pointsDetails/pointsDetails`">
						<image class='pointsMall_fd2_0_c0_c0' mode="aspectFit" :src='STATIC_URL+"242.png"'></image>
						<text class='pointsMall_fd2_0_c0_c1'>积分明细</text>
					</view>
					<view class='flex flex-direction flex-wrap align-center' @tap.stop="handleJumpDiy"
						data-type="navigateTo" :data-url="`/pages/my/signIn/signIn`">
						<image class='pointsMall_fd2_0_c0_c0' mode="aspectFit" :src='STATIC_URL+"313.png"'></image>
						<text class='pointsMall_fd2_0_c0_c1'>去签到</text>
					</view>
				</view>
				<view class='flex flex-wrap align-center pointsMall_fd2_1'>
					<image class='pointsMall_fd2_1_c0' mode="aspectFit" :src='STATIC_URL+"244.png"'></image>
					<text class='pointsMall_fd2_1_c1'>积分兑换</text>
					<text class='pointsMall_fd2_1_c2'>小积分抽大奖</text>
				</view>
			</view>

			<!---flex布局flex布局结束-->
			<!---积分列表flex布局开始-->
			<view class="flex flex-wrap align-center justify-between benben-flex-layout pointsMall_flex_3">
				<template v-for='(item,key0) in dataList'>
					<view class='flex flex-direction flex-wrap align-stretch pointsMall_fd3_0' @tap.stop="handleJumpDiy"
						data-type="navigateTo"
						:data-url="`/pages/integral/pointsProductDetails/pointsProductDetails?id=${item.aid}`"
						:key='key0'>
						<image class='pointsMall_fd3_0_c0' mode="aspectFill" :src='item.tupian'></image>
						<view class='flex flex-direction flex-wrap align-stretch pointsMall_fd3_0_c1'>
							<text class='pointsMall_fd3_0_c1_c0'>{{item.name}}</text>
							<view class='flex flex-wrap align-center pointsMall_fd3_0_c1_c1'>
								<text class='pointsMall_fd3_0_c1_c1_c0'>{{item.integral}}</text>
								<text class='pointsMall_fd3_0_c1_c1_c1'>积分</text>
							</view>
						</view>
					</view>
				</template>
				<fu-empty :pagingListLoadedAll="pagingListLoadedAll" :pagingListNoListData="pagingListNoListData"
					:listDataLength="listDataLength" :isLoadInit="isLoadInit"></fu-empty>
			</view>

			<!---积分列表flex布局结束-->
			<benben-popup v-model="popupShow1679739249303" :mask="true" :mask-close-able="true" mode='center'>
				<!---积分规则弹窗flex布局开始-->
				<view class="flex flex-direction flex-wrap align-center benben-flex-layout">
					<view class='flex flex-direction flex-wrap align-center pointsMall_fd4_0'>
						<text class='pointsMall_fd4_0_c0'>积分规则</text>

						<scroll-view class='pointsMall_fd4_0_c1' :scroll-y='true' :show-scrollbar='true'>
							<view class='flex benben-scroll flex align-center'>
								<jyf-parser class='pointsMall_fd4_0_c1_c0' :html="withdrawalData.body | richTextFormat">
								</jyf-parser>
							</view>
						</scroll-view>

					</view>
					<image class='pointsMall_fd4_1' mode="aspectFit" :src='STATIC_URL+"245.png"'
						@tap.stop="popupShow1679739249303=false"></image>
				</view>

				<!---积分规则弹窗flex布局结束-->

			</benben-popup>


		</view>
	</view>
</template>
<script>
	import pagingList from '@/common/mixin/paging_list.js';
	import {
		validate
	} from '@/common/utils/validate.js'

	export default {
		components: {},
		mixins: [pagingList],

		data() {
			return {
				"popupShow1679739249303": false,
				"minixPagingListsApi": "",
				"pageingListApiMethod": "",
				"allowOnloadGetList": false,
				"withdrawalData": {
					"aid": "",
					"title": "",
					"body": "",
					"create_time": ""
				},
				"userData": {
					"invite_code": "",
					"address": "",
					"address_code": "",
					"hobby": "",
					"tags": "",
					"id": "",
					"userlevel_id": "",
					"mobile": "",
					"real_name": "",
					"nickname": "",
					"avatar": "",
					"account": "",
					"email": "",
					"birthday": "",
					"gender": "",
					"create_time": "",
					"user_money": "",
					"freeze_money": "",
					"total_consumption_money": "",
					"score": "",
					"_mobile": "",
					"coupon": "",
					"collection_count": "",
					"browse_count": "",
					"total_money": "",
					"certified": "",
					"is_pay_password": "",
					"fuwuxingji": "",
					"gongzuozhuangtai": "",
					"shuzi": "",
					"jifen": "",
					"yajin": "",
					"level": {
						"aid": "",
						"name": "",
						"icon": "",
						"levelid": ""
					},
					"invite_num": "",
					"commission": ""
				},
				"dataList": []
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},
			userInfo: {
				get() {
					return this.$store.state.userInfo
				},
				set() {
					this.$store.commit('updateUserInfo', value)
				},
			}
		},
		watch: {},
		onLoad(options) {
			this.getWithdrawalFunc()
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {
			this.getUserDataFunc()
			this.getIntegralFunc()
		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {
			this.getUserDataFunc()
			this.getIntegralFunc()
		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			//获取提现规则
			async getWithdrawalFunc() {
				//请求方法
				//数据验证

				let datawithdrawalData = await this.$api.post(global.apiUrls.post636c78ae2216b, {
					aid: '13'
				});

				if (datawithdrawalData.data.code != 1) {
					this.$message.info(datawithdrawalData.data.msg);
					return
				}
				let infowithdrawalData = datawithdrawalData.data;
				this.withdrawalData = infowithdrawalData.data

			},
			//获取用户积分
			async getUserDataFunc() {
				//请求方法
				//数据验证

				let datauserData = await this.$api.get(global.apiUrls.post5c78c4772da97, {
					user_id: this.userInfo.id
				});

				if (datauserData.data.code != 1) {
					this.$message.info(datauserData.data.msg);
					return
				}
				let infouserData = datauserData.data;
				this.userData = infouserData.data

			},
			//获取积分列表信息
			getIntegralFunc() {
				this.minixPagingListsApi = global.apiUrls.post63c60100c6090;
				this.pageingListApiMethod = 'get';
				this.allowOnloadGetList = false;
				this.pagingListPostDataContent = {}
				this.listData = [];
				this.dataList = this.listData;
				this.pagingListToggle();

			},
			pagingListPostData() {
				return this.pagingListPostDataContent
			}
		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: url(image-path('240.png')) no-repeat, rgba(248, 248, 248, 1);
		background-size: 100% auto;
	}

	.pointsMall_flex_0 {
		background: url(image-path('240.png')) no-repeat, transparent;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.pointsMall_fd0_0_c1 {
		font-size: 36rpx;
		font-weight: 500;
		color: #fff;
	}

	.pointsMall_fd0_0_c0_c0 {
		font-size: 32rpx;
		color: #fff;
	}

	.pointsMall_fd0_0_c0 {
		width: 120rpx;
		height: 88rpx;
	}

	.pointsMall_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
		height: 88rpx;
	}

	.pointsMall_flex_1 {
		padding: 56rpx 0rpx 40rpx 0rpx;
		position: relative;
	}

	.pointsMall_fd1_2 {
		background: rgba(51, 51, 51, 0.16);
		border-radius: 40rpx 0rpx 0rpx 40rpx;
		color: #fff;
		position: absolute;
		top: 56rpx;
		right: 0rpx;
		padding: 0rpx 24rpx 0rpx 24rpx;
		font-size: 24rpx;
		font-weight: 400;
		line-height: 56rpx;
	}

	.pointsMall_fd1_1 {
		color: #FFFFFF;
		font-size: 28rpx;
		font-weight: 500;
		margin: 16rpx 0rpx 0rpx 0rpx;
	}

	.pointsMall_fd1_0 {
		color: #FFFFFF;
		font-size: 56rpx;
		font-weight: 700;
	}

	.pointsMall_flex_2 {
		padding: 0rpx 32rpx 0rpx 32rpx;
	}

	.pointsMall_fd2_1_c2 {
		color: #666666;
		font-size: 28rpx;
		font-weight: 400;
	}

	.pointsMall_fd2_1_c1 {
		color: #333333;
		font-size: 36rpx;
		font-weight: 500;
		margin: 0rpx 24rpx 0rpx 16rpx;
	}

	.pointsMall_fd2_1_c0 {
		width: 31rpx;
		height: 34rpx;
	}

	.pointsMall_fd2_1 {
		margin: 32rpx 0rpx 32rpx 0rpx;
	}

	.pointsMall_fd2_0_c0_c1 {
		color: #323232;
		font-size: 24rpx;
		font-weight: 400;
		margin: 12rpx 0rpx 0rpx 0rpx;
	}

	.pointsMall_fd2_0_c0_c0 {
		width: 64rpx;
		height: 64rpx;
	}

	.pointsMall_fd2_0 {
		background: #FFFFFF;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		padding: 32rpx 78rpx 32rpx 66rpx;
	}

	.pointsMall_flex_3 {
		padding: 24rpx 24rpx 32rpx 24rpx;
	}

	.pointsMall_fd3_0_c1_c1_c1 {
		color: #333333;
		font-size: 20rpx;
		font-weight: 400;
		line-height: 35rpx;
		margin: 0rpx 0rpx 0rpx 8rpx;
	}

	.pointsMall_fd3_0_c1_c1_c0 {
		color: #F02325;
		font-size: 32rpx;
		font-weight: 700;
		line-height: 35rpx;
	}

	.pointsMall_fd3_0_c1_c1 {
		margin: 33rpx 0rpx 0rpx 0rpx;
	}

	.pointsMall_fd3_0_c1_c0 {
		color: #333333;
		font-size: 26rpx;
		font-weight: 500;
		line-height: 35rpx;
		-webkit-line-clamp: 1;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
	}

	.pointsMall_fd3_0_c1 {
		margin: 24rpx 20rpx 24rpx 20rpx;
	}

	.pointsMall_fd3_0_c0 {
		width: 346rpx;
		height: 346rpx;
		border-radius: 16rpx 16rpx 0rpx 0rpx;
	}

	.pointsMall_fd3_0 {
		background: #fff;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		background-size: 100% auto !important;
		width: 346rpx;
		margin: 0rpx 0rpx 20rpx 0rpx;
	}

	.pointsMall_fd4_1 {
		width: 55rpx;
		height: 55rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
	}

	::v-deep .pointsMall_fd4_0_c1_c0 {
		width: 100%;
	}

	.pointsMall_fd4_0_c1 {
		touch-action: none;
		padding: 0rpx 32rpx 0rpx 32rpx;
		margin: 0rpx 0rpx 28rpx 0rpx;
		max-height: 500rpx;
	}

	.pointsMall_fd4_0_c0 {
		font-size: 32rpx;
		font-weight: 500;
		color: #333333;
		margin: 0rpx 0rpx 32rpx 0rpx;
		line-height: 45rpx;
	}

	.pointsMall_fd4_0 {
		background: #fff;
		width: 540rpx;
		background-size: 100% auto !important;
		border-radius: 24rpx 24rpx 24rpx 24rpx;
		padding: 40rpx 0rpx 0rpx 0rpx;
		margin: 0rpx 0rpx 40rpx 0rpx;
	}
</style>